home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97b.txt / 000085_icon-group-sender _Mon Oct 20 08:09:52 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA26475
  4.     for <icon-group-addresses@cheltenham.CS.Arizona.EDU>; Mon, 20 Oct 1997 08:09:50 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA19175; Mon, 20 Oct 1997 08:09:49 -0700
  7. To: icon-group@cs.arizona.edu
  8. Date: Sun, 19 Oct 1997 15:44:33 +1000
  9. From: Stuart.Robinson@anu.edu.au (Stuart Robinson)
  10. Message-Id: <Stuart.Robinson-1910971544360001@asianstmg-221.anu.edu.au>
  11. Organization: ANU
  12. Sender: icon-group-request@cs.arizona.edu
  13. Subject: counting letters
  14. Errors-To: icon-group-errors@cs.arizona.edu
  15. Status: RO
  16.  
  17. What would be the best way to design an Icon program that takes a text
  18. file as input, counts up the instances of every letter in the alphabet
  19. (ignoring other characters and distinguishing between uppercase and
  20. lowercase letters), and spits out the results of the count as output?
  21.  
  22. For example, the following input
  23.  
  24. abcdefghjijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()
  25.  
  26. would produce the following output
  27.  
  28. a  1
  29. b  2
  30. [etc.]
  31. A  1
  32. b  2
  33. [etc.]
  34. [nothing for the non-alphabetic characters]
  35.  
  36. Cheers,
  37. Stuart Robinson
  38.  
  39. -- 
  40. Stuart Robinson <Stuart.Robinson@no-spam.anu.edu.au>
  41. The Australian National University
  42. *TO REPLY, REMOVE "no-spam." FROM E-MAIL ADDRESS GIVEN ABOVE
  43.